function bindEvent(elem,type,fn) {
  elem.addEventListener(type,fn)
}

const p5 = document.getElementById('p5')
const list1 = document.getElementById('list')
const body = document.body

bindEvent(body,'click',function() {
  console.log('取消');
})

const p1 = document.getElementById('p1')
bindEvent(p1,'click',function() {
  Event.stopPropagation()
  console.log('确定');
})